from django.conf.urls import url

from . import views
from django.views.generic import TemplateView

urlpatterns = [
    url(r'^$', views.IndexView.as_view(), name='index'),
    url(r'^addship/$', views.AddShipView.as_view(), name='addship'),
    url(r'^ship_list/$', views.ShipListView.as_view(), name='ship_list'),
    url(r'^addship/updateship/$', views.AddShipRedirectView.as_view(url='/map/'), name='addship_redirect'),
    url(r'^ship_id/(?P<ship_id>[0-9]+)/$', views.get_ship_location, name='get_ship_location'),
    url(r'^history_line/(?P<ship_id>[0-9]+)/$', views.get_ship_history_line, name='get_ship_history_line'),
    url(r'^data_detail/(?P<ship_id>[0-9]+)/$', views.MonitorView.as_view(), name='data_detail'),
    url(r'^history_data/(?P<ship_id>[0-9]+)/$', views.HistoryView.as_view(), name='data_detail'),
    url(r'^history_data/(?P<ship_id>[0-9]+)/(?P<select>[^\d]+)/$', views.select, name='data_detail_select'),
    url(r'^events1/(?P<ship_id>[0-9]+)/$', views.BoardEvents.as_view(), name='events1'),
    url(r'^events2/(?P<ship_id>[0-9]+)/$', views.HistoryEvents.as_view(), name='events2'),
    url(r'^ship_detail/(?P<ship_id>[0-9]+)/$', views.get_ship_detail, name='ship_detail'),
    url(r'^ship_detail/select_history_time/(?P<ship_id>[0-9]+)/$', views.ship_detail_select_history, name='ship_detail_select_history'),
]
